package com.yx.muchdatasource.controller;

import com.yx.muchdatasource.service.DataSourceService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.sql.DataSource;
import java.util.List;

/**
 * @author: yaoxin
 * @Date: 2022/3/8 - 03 - 08 - 17:03
 * @Description: com.yx.muchdatasource.controller
 * @version: 1.0
 */
@RestController
public class DataSourceController {
    @Autowired
    DataSourceService dataSourceService;

    @GetMapping("one")
    public Object getOne(){
        List<String> names = dataSourceService.selectOne();
        return names;
    }

    @GetMapping("tow")
    public Object getTwo(){
        List<String> names = dataSourceService.selectTwo();
        return names;
    }
    @GetMapping("test")
    public Object test(){
        return "test";
    }
}
